home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / STRINGS / TPSTR7 / EXAM30.PAS < prev    next >
Pascal/Delphi Source File  |  1993-03-15  |  3KB  |  59 lines

  1. Program Exam30;
  2.  
  3. {**************************************************************************}
  4. {                                                                          }
  5. { Ce programme démontre les possibilités de StrRev?.                       }
  6. {                                                                          }
  7. {**************************************************************************}
  8.  
  9. Uses
  10.   TpStr;
  11.  
  12. Var
  13.   S1 ,
  14.   S2 : String;
  15.  
  16. {  ---------------------------------------------------------------         }
  17. {  Procedure   StrRev(Var Str1: String);                                   }
  18. {  ---------------------------------------------------------------         }
  19. {                                                                          }
  20. {  Effet     : Renverse la chaîne <Str1>.                                  }
  21. {                                                                          }
  22. {  Usage     : Chaîne pascal.                                              }
  23. {                                                                          }
  24. {  Vitesse   : 7800/s                                                      }
  25. {                                                                          }
  26. { -------------------------------------------------------------------------}
  27.  
  28. Procedure Test1;
  29. Begin
  30.   S1 := 'abcdefghijklmnopqrstuvwxyz';
  31.   StrRev(S1);
  32. end;
  33.  
  34. {  ---------------------------------------------------------------         }
  35. {  Function   StrRev_(Str1: String):String;                                }
  36. {  ---------------------------------------------------------------         }
  37. {                                                                          }
  38. {  Effet     : Idem, transformé en fonction.                               }
  39. {                                                                          }
  40. {  Usage     : Chaîne pascal.                                              }
  41. {                                                                          }
  42. {  Vitesse   : 7800/s                                                      }
  43. {                                                                          }
  44. { -------------------------------------------------------------------------}
  45.  
  46. Procedure Test2;
  47. Begin
  48.   S1 := 'zyxwvutsrqponmlkjihgfedcba';
  49.   S2 := StrRev_(S1);
  50.   S2 := StrRev_('abcde');
  51. end;
  52.  
  53. Begin
  54.   Test1;
  55.   Test2;
  56. End.
  57.  
  58. { -------------------------------------------------------------------------}
  59.